// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
	compatibilityDate: '2025-07-15',
	devtools: { enabled: true },
	css: ['~/assets/css/reset.css', '~/assets/css/global.css'],
	// routeRules: {
	// 	'/issue/children': { redirect: '/children' },
	// },
	hooks: {
		'pages:extend'(pages) {
			// console.log(pages, pages[0]?.children);
			// const childrenPage = pages.find(page => page.name === 'issue');
			// if (childrenPage) {
			// 	childrenPage?.children?.forEach(child => {
			// 		child.path = '/' + child.path;
			// 	});
			// }
			// console.log(childrenPage)
		},
		'pages:resolved'(pages) {
			const childrenPage = pages.find(page => page.name === 'issue');
			if (childrenPage) {
				childrenPage?.children?.forEach(child => {
					child.path = '/' + child.path;
				});
			}
			// console.log(childrenPage?.children);
		},
	},
	// modules: ['nuxt-typed-router'],
	modules: ['@element-plus/nuxt'],
	vite: {
		css: {
			preprocessorOptions: {
				scss: {
					// additionalData: `@use "~/assets/scss/global.scss" as *;@use "~/assets/scss/mixin.scss" as *;`,
					additionalData: `@use "~/assets/scss/mixin.scss" as *;`,
				},
			},
		},
	},
});
